<?php

use Illuminate\Database\Seeder;

class ShopTableSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        // DB::table('users')->insert([
        //     'name' => str_random(10),
        //     'email' => str_random(10).'@gmail.com',
        //     'password' => bcrypt('secret'),
        //     'openid' => str_random(32),
        //     'nickname' => str_random(10),
        // ]);

        factory(App\Models\Shop::class, 50)->create()->each(function ($u) {
            $u->product()->save(factory(App\Models\Product::class)->make());
            $u->order()->save(factory(App\Models\Order::class)->make());
        });
    }
}
